3.1.28 \(\int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx\) [28]

3.1.28.1 Optimal result
3.1.28.2 Mathematica [A] (verified)
3.1.28.3 Rubi [A] (verified)
3.1.28.4 Maple [A] (verified)
3.1.28.5 Fricas [B] (verification not implemented)
3.1.28.6 Sympy [F]
3.1.28.7 Maxima [A] (verification not implemented)
3.1.28.8 Giac [B] (verification not implemented)
3.1.28.9 Mupad [B] (verification not implemented)

3.1.28.1 Optimal result

Integrand size = 24, antiderivative size = 118 \[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {7 a^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {7 i a^2 \sec ^5(c+d x)}{30 d}+\frac {7 a^2 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {7 a^2 \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d} \]

output
7/16*a^2*arctanh(sin(d*x+c))/d+7/30*I*a^2*sec(d*x+c)^5/d+7/16*a^2*sec(d*x+ 
c)*tan(d*x+c)/d+7/24*a^2*sec(d*x+c)^3*tan(d*x+c)/d+1/6*I*sec(d*x+c)^5*(a^2 
+I*a^2*tan(d*x+c))/d
 
3.1.28.2 Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.92 \[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {7 a^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {2 i a^2 \sec ^5(c+d x)}{5 d}+\frac {7 a^2 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {7 a^2 \sec ^3(c+d x) \tan (c+d x)}{24 d}-\frac {a^2 \sec ^5(c+d x) \tan (c+d x)}{6 d} \]

input
Integrate[Sec[c + d*x]^5*(a + I*a*Tan[c + d*x])^2,x]
 
output
(7*a^2*ArcTanh[Sin[c + d*x]])/(16*d) + (((2*I)/5)*a^2*Sec[c + d*x]^5)/d + 
(7*a^2*Sec[c + d*x]*Tan[c + d*x])/(16*d) + (7*a^2*Sec[c + d*x]^3*Tan[c + d 
*x])/(24*d) - (a^2*Sec[c + d*x]^5*Tan[c + d*x])/(6*d)
 
3.1.28.3 Rubi [A] (verified)

Time = 0.61 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.03, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3042, 3979, 3042, 3967, 3042, 4255, 3042, 4255, 3042, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (c+d x)^5 (a+i a \tan (c+d x))^2dx\)

\(\Big \downarrow \) 3979

\(\displaystyle \frac {7}{6} a \int \sec ^5(c+d x) (i \tan (c+d x) a+a)dx+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{6} a \int \sec (c+d x)^5 (i \tan (c+d x) a+a)dx+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 3967

\(\displaystyle \frac {7}{6} a \left (a \int \sec ^5(c+d x)dx+\frac {i a \sec ^5(c+d x)}{5 d}\right )+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{6} a \left (a \int \csc \left (c+d x+\frac {\pi }{2}\right )^5dx+\frac {i a \sec ^5(c+d x)}{5 d}\right )+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {7}{6} a \left (a \left (\frac {3}{4} \int \sec ^3(c+d x)dx+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {i a \sec ^5(c+d x)}{5 d}\right )+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{6} a \left (a \left (\frac {3}{4} \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {i a \sec ^5(c+d x)}{5 d}\right )+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {7}{6} a \left (a \left (\frac {3}{4} \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {i a \sec ^5(c+d x)}{5 d}\right )+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{6} a \left (a \left (\frac {3}{4} \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {i a \sec ^5(c+d x)}{5 d}\right )+\frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {i \sec ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{6 d}+\frac {7}{6} a \left (a \left (\frac {3}{4} \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 d}\right )+\frac {i a \sec ^5(c+d x)}{5 d}\right )\)

input
Int[Sec[c + d*x]^5*(a + I*a*Tan[c + d*x])^2,x]
 
output
((I/6)*Sec[c + d*x]^5*(a^2 + I*a^2*Tan[c + d*x]))/d + (7*a*(((I/5)*a*Sec[c 
 + d*x]^5)/d + a*((Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + (3*(ArcTanh[Sin[c 
+ d*x]]/(2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2*d)))/4)))/6
 

3.1.28.3.1 Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3967
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a   Int[(d 
*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] 
|| NeQ[a^2 + b^2, 0])
 

rule 3979
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)])^(n_), x_Symbol] :> Simp[b*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^(n 
 - 1)/(f*(m + n - 1))), x] + Simp[a*((m + 2*n - 2)/(m + n - 1))   Int[(d*Se 
c[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f, 
 m}, x] && EqQ[a^2 + b^2, 0] && GtQ[n, 0] && NeQ[m + n - 1, 0] && IntegersQ 
[2*m, 2*n]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
3.1.28.4 Maple [A] (verified)

Time = 19.59 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.13

method result size
risch \(-\frac {i a^{2} \left (105 \,{\mathrm e}^{11 i \left (d x +c \right )}+595 \,{\mathrm e}^{9 i \left (d x +c \right )}-1686 \,{\mathrm e}^{7 i \left (d x +c \right )}-1386 \,{\mathrm e}^{5 i \left (d x +c \right )}-595 \,{\mathrm e}^{3 i \left (d x +c \right )}-105 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}-\frac {7 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{16 d}+\frac {7 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{16 d}\) \(133\)
derivativedivides \(\frac {-a^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )+\frac {2 i a^{2}}{5 \cos \left (d x +c \right )^{5}}+a^{2} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(152\)
default \(\frac {-a^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )+\frac {2 i a^{2}}{5 \cos \left (d x +c \right )^{5}}+a^{2} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(152\)

input
int(sec(d*x+c)^5*(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
-1/120*I*a^2/d/(exp(2*I*(d*x+c))+1)^6*(105*exp(11*I*(d*x+c))+595*exp(9*I*( 
d*x+c))-1686*exp(7*I*(d*x+c))-1386*exp(5*I*(d*x+c))-595*exp(3*I*(d*x+c))-1 
05*exp(I*(d*x+c)))-7/16/d*a^2*ln(exp(I*(d*x+c))-I)+7/16/d*a^2*ln(exp(I*(d* 
x+c))+I)
 
3.1.28.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 364 vs. \(2 (102) = 204\).

Time = 0.25 (sec) , antiderivative size = 364, normalized size of antiderivative = 3.08 \[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {-210 i \, a^{2} e^{\left (11 i \, d x + 11 i \, c\right )} - 1190 i \, a^{2} e^{\left (9 i \, d x + 9 i \, c\right )} + 3372 i \, a^{2} e^{\left (7 i \, d x + 7 i \, c\right )} + 2772 i \, a^{2} e^{\left (5 i \, d x + 5 i \, c\right )} + 1190 i \, a^{2} e^{\left (3 i \, d x + 3 i \, c\right )} + 210 i \, a^{2} e^{\left (i \, d x + i \, c\right )} + 105 \, {\left (a^{2} e^{\left (12 i \, d x + 12 i \, c\right )} + 6 \, a^{2} e^{\left (10 i \, d x + 10 i \, c\right )} + 15 \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} + 20 \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 15 \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 6 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 105 \, {\left (a^{2} e^{\left (12 i \, d x + 12 i \, c\right )} + 6 \, a^{2} e^{\left (10 i \, d x + 10 i \, c\right )} + 15 \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} + 20 \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 15 \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 6 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{240 \, {\left (d e^{\left (12 i \, d x + 12 i \, c\right )} + 6 \, d e^{\left (10 i \, d x + 10 i \, c\right )} + 15 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 20 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 15 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 6 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

input
integrate(sec(d*x+c)^5*(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")
 
output
1/240*(-210*I*a^2*e^(11*I*d*x + 11*I*c) - 1190*I*a^2*e^(9*I*d*x + 9*I*c) + 
 3372*I*a^2*e^(7*I*d*x + 7*I*c) + 2772*I*a^2*e^(5*I*d*x + 5*I*c) + 1190*I* 
a^2*e^(3*I*d*x + 3*I*c) + 210*I*a^2*e^(I*d*x + I*c) + 105*(a^2*e^(12*I*d*x 
 + 12*I*c) + 6*a^2*e^(10*I*d*x + 10*I*c) + 15*a^2*e^(8*I*d*x + 8*I*c) + 20 
*a^2*e^(6*I*d*x + 6*I*c) + 15*a^2*e^(4*I*d*x + 4*I*c) + 6*a^2*e^(2*I*d*x + 
 2*I*c) + a^2)*log(e^(I*d*x + I*c) + I) - 105*(a^2*e^(12*I*d*x + 12*I*c) + 
 6*a^2*e^(10*I*d*x + 10*I*c) + 15*a^2*e^(8*I*d*x + 8*I*c) + 20*a^2*e^(6*I* 
d*x + 6*I*c) + 15*a^2*e^(4*I*d*x + 4*I*c) + 6*a^2*e^(2*I*d*x + 2*I*c) + a^ 
2)*log(e^(I*d*x + I*c) - I))/(d*e^(12*I*d*x + 12*I*c) + 6*d*e^(10*I*d*x + 
10*I*c) + 15*d*e^(8*I*d*x + 8*I*c) + 20*d*e^(6*I*d*x + 6*I*c) + 15*d*e^(4* 
I*d*x + 4*I*c) + 6*d*e^(2*I*d*x + 2*I*c) + d)
 
3.1.28.6 Sympy [F]

\[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=- a^{2} \left (\int \tan ^{2}{\left (c + d x \right )} \sec ^{5}{\left (c + d x \right )}\, dx + \int \left (- 2 i \tan {\left (c + d x \right )} \sec ^{5}{\left (c + d x \right )}\right )\, dx + \int \left (- \sec ^{5}{\left (c + d x \right )}\right )\, dx\right ) \]

input
integrate(sec(d*x+c)**5*(a+I*a*tan(d*x+c))**2,x)
 
output
-a**2*(Integral(tan(c + d*x)**2*sec(c + d*x)**5, x) + Integral(-2*I*tan(c 
+ d*x)*sec(c + d*x)**5, x) + Integral(-sec(c + d*x)**5, x))
 
3.1.28.7 Maxima [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.53 \[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {5 \, a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 8 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 30 \, a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - \frac {192 i \, a^{2}}{\cos \left (d x + c\right )^{5}}}{480 \, d} \]

input
integrate(sec(d*x+c)^5*(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")
 
output
-1/480*(5*a^2*(2*(3*sin(d*x + c)^5 - 8*sin(d*x + c)^3 - 3*sin(d*x + c))/(s 
in(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) - 3*log(sin(d*x + 
 c) + 1) + 3*log(sin(d*x + c) - 1)) + 30*a^2*(2*(3*sin(d*x + c)^3 - 5*sin( 
d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1 
) + 3*log(sin(d*x + c) - 1)) - 192*I*a^2/cos(d*x + c)^5)/d
 
3.1.28.8 Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 237 vs. \(2 (102) = 204\).

Time = 0.55 (sec) , antiderivative size = 237, normalized size of antiderivative = 2.01 \[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {105 \, a^{2} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 105 \, a^{2} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) + \frac {2 \, {\left (135 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 480 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{10} - 445 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 480 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 330 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 960 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 330 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 960 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 445 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 135 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 96 i \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{6}}}{240 \, d} \]

input
integrate(sec(d*x+c)^5*(a+I*a*tan(d*x+c))^2,x, algorithm="giac")
 
output
1/240*(105*a^2*log(tan(1/2*d*x + 1/2*c) + 1) - 105*a^2*log(tan(1/2*d*x + 1 
/2*c) - 1) + 2*(135*a^2*tan(1/2*d*x + 1/2*c)^11 - 480*I*a^2*tan(1/2*d*x + 
1/2*c)^10 - 445*a^2*tan(1/2*d*x + 1/2*c)^9 + 480*I*a^2*tan(1/2*d*x + 1/2*c 
)^8 - 330*a^2*tan(1/2*d*x + 1/2*c)^7 - 960*I*a^2*tan(1/2*d*x + 1/2*c)^6 - 
330*a^2*tan(1/2*d*x + 1/2*c)^5 + 960*I*a^2*tan(1/2*d*x + 1/2*c)^4 - 445*a^ 
2*tan(1/2*d*x + 1/2*c)^3 - 96*I*a^2*tan(1/2*d*x + 1/2*c)^2 + 135*a^2*tan(1 
/2*d*x + 1/2*c) + 96*I*a^2)/(tan(1/2*d*x + 1/2*c)^2 - 1)^6)/d
 
3.1.28.9 Mupad [B] (verification not implemented)

Time = 7.90 (sec) , antiderivative size = 290, normalized size of antiderivative = 2.46 \[ \int \sec ^5(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {7\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {-\frac {9\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}}{8}+a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,4{}\mathrm {i}+\frac {89\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{24}-a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,4{}\mathrm {i}+\frac {11\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,8{}\mathrm {i}+\frac {11\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}-a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,8{}\mathrm {i}+\frac {89\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,4{}\mathrm {i}}{5}-\frac {9\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8}-\frac {a^2\,4{}\mathrm {i}}{5}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

input
int((a + a*tan(c + d*x)*1i)^2/cos(c + d*x)^5,x)
 
output
(7*a^2*atanh(tan(c/2 + (d*x)/2)))/(8*d) - ((a^2*tan(c/2 + (d*x)/2)^2*4i)/5 
 + (89*a^2*tan(c/2 + (d*x)/2)^3)/24 - a^2*tan(c/2 + (d*x)/2)^4*8i + (11*a^ 
2*tan(c/2 + (d*x)/2)^5)/4 + a^2*tan(c/2 + (d*x)/2)^6*8i + (11*a^2*tan(c/2 
+ (d*x)/2)^7)/4 - a^2*tan(c/2 + (d*x)/2)^8*4i + (89*a^2*tan(c/2 + (d*x)/2) 
^9)/24 + a^2*tan(c/2 + (d*x)/2)^10*4i - (9*a^2*tan(c/2 + (d*x)/2)^11)/8 - 
(a^2*4i)/5 - (9*a^2*tan(c/2 + (d*x)/2))/8)/(d*(15*tan(c/2 + (d*x)/2)^4 - 6 
*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (d*x)/2)^6 + 15*tan(c/2 + (d*x)/2)^8 
- 6*tan(c/2 + (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1))